home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / WebSites / Wirenet / files / 0800timer.lha / 0800Timer.mrx < prev   
Text File  |  2000-02-17  |  4KB  |  117 lines

  1. /*
  2.     MUI Progress bar for 0800Timer
  3. */
  4.  
  5. /* ;;; Initialise */
  6. options results
  7. address command
  8. signal on error
  9. VerStr  = '$VER: 0800Timer.mrx 1.0 (6.2.00)'
  10. VerStr  = subword(VerStr,2)||'0a'x||'(c) Neil Bothwick, Wirenet'
  11. GuiPort = '0800TIMER'
  12. PrgPort = GuiPort'-PRG'
  13. WinTitle = 'Wirenet 0800 Timer'
  14. MaxMins = 360
  15. ;;;
  16. /* ;;; Define MUI variables */
  17. MUIA_List_Quiet                   = 0x8042d8c7
  18. MUIM_List_Select                  = 0x804252d8
  19. MUIV_List_Select_All              = -2
  20. MUIV_List_Select_On               = 1
  21. MUIV_List_Select_Ask              = 3
  22. MUIA_List_First                   = 0x804238d4
  23. MUIM_List_Remove                  = 0x8042647e
  24. MUIV_List_Remove_Selected         = -3
  25. MUIA_List_Entries                 = 0x80421654
  26. MUIA_List_Quiet                   = 0x8042d8c7
  27. MUIA_Listview_MultiSelect         = 0x80427e08
  28. MUIV_Listview_MultiSelect_Default = 1
  29. MUIA_Gauge_Current                = 0x8042f0dd
  30. MUIA_Gauge_Divide                 = 0x8042d8df
  31. MUIA_Gauge_Horiz                  = 0x804232dd
  32. MUIA_Gauge_InfoText               = 0x8042bf15
  33. MUIA_Gauge_Max                    = 0x8042bcdb
  34. MUIA_Group_Columns                = 0x8042f416
  35. MUIA_Menuitem_Shortcut            = 0x80422030
  36. MUIA_Application_Active           = 0x804260ab
  37. MUIA_Application_Author           = 0x80424842
  38. MUIA_Application_Copyright        = 0x8042ef4d
  39. MUIA_Application_Description      = 0x80421fc6
  40. MUIA_Application_HelpFile         = 0x804293f4
  41. MUIA_Application_Iconified        = 0x8042a07f
  42. MUIA_Application_Title            = 0x804281b8
  43. MUIA_Application_Version          = 0x8042b33f
  44. MUIA_Application_Sleep            = 0x80425711
  45. MUIM_Application_AboutMUI         = 0x8042d21d
  46. MUIA_Slider_Horiz                 = 0x8042fad1
  47. MUIA_Slider_Level                 = 0x8042ae3a
  48. MUIA_Slider_Max                   = 0x8042d78a
  49. MUIA_Slider_Min                   = 0x8042e404
  50. MUIA_Slider_Quiet                 = 0x80420b26
  51. MUIA_Slider_Reverse               = 0x8042f2a0
  52. TRUE = 1
  53. FALSE = 0
  54. ;;;
  55. /* ;;; Open arexx port and GUI */
  56. thisport = openport(PrgPort)
  57. if thisport = 0 then exit
  58. address(GuiPort)
  59. window id MAIN port PrgPort command 'QUIT' title '"'WinTitle'"'
  60.     gauge id TIME attrs MUIA_Gauge_Horiz MUIA_Gauge_InfoText '' MUIA_Gauge_Max MaxMins label '%ld minutes used'
  61.     endwindow
  62.  
  63. 'application' MUIA_Application_Version '$VER: 0800Timer 1.0 (6.2.00)'
  64. 'application' MUIA_Application_Author 'Neil Bothwick'
  65. 'application' MUIA_Application_Copyright '© 2000 by Neil Bothwick, Wirenet'
  66. 'application' MUIA_Application_Title '0800Timer'
  67. 'application' MUIA_Application_Description 'Keeps track of 0800 time used'
  68. ;;;
  69. /* ;;; Main loop */
  70. do forever
  71.     call waitpkt(PrgPort)
  72.     packet = getpkt(PrgPort)
  73.     if packet = '0000 0000'x then iterate
  74.     cmd = getarg(packet)
  75.     call reply(packet,0)
  76.     select
  77.         when cmd = 'QUIT' then call CleanUp()
  78.         when cmd = 'ONLINE' then nop
  79.         when cmd = 'OFFLINE' then nop
  80.         otherwise do
  81.             'gauge id TIME attrs' MUIA_Gauge_Current cmd
  82.             /*'gauge id TIME attrs' MUIA_Gauge_InfoText '"'cmd'"'*/
  83.             end
  84.         end
  85.     end
  86. ;;;
  87. /* ;;; Cleanup and exit */
  88. CleanUp:
  89.     address(GuiPort)
  90.     'QUIT'
  91.     exit
  92. ;;;
  93. /* ;;; Show a message in a requester */
  94. ReqMsg:
  95.     parse arg msg
  96.     oldaddr = address()
  97.     address(GuiPort)
  98.     'request id MAIN title "'WinTitle'" gadgets "OK" string' msg
  99.     choice = result
  100.     address(oldaddr)
  101.     return choice
  102. ;;;
  103. /* ;;; Error handler */
  104. Error:
  105.     if RC = 5 then return
  106.     oldaddress = address()
  107.     address(GuiPort)
  108.     call ReqMsg('Error' RC 'in line' sigl)
  109.     address(oldaddress)
  110.     call Cleanup()
  111.     return
  112. ;;;
  113.  
  114.  
  115.  
  116.  
  117.